//
// Created by ziya on 2021/10/18.
//

#ifndef THREAD_POOL_THREADPOOL_H
#define THREAD_POOL_THREADPOOL_H

#include "../../include/common.h"
#include "../../thread/hpp/JavaThread.h"

class ThreadPool {
private:
    map<pthread_t ,JavaThread*> _threadMap;

    JavaThread** _thread_ids ;

public:

    ThreadPool(int core_size, int max_size);


    pthread_mutex_t  _lock[1];

    pthread_cond_t   _condt[1];

    void expand();

    void shrink();

    int     _busy_size;
    int     _live_size;
    int     _max_size;
    int     _core_size;
};


#endif //THREAD_POOL_THREADPOOL_H
